<?php
class GetEndHistoryInfo{
	public $auctionId;
	
	public function getHistorys($limit=10){
		$historySql='
					SELECT
						log.id,
						log.winner_price,
						us.user_name,
						log.action
					FROM
						auction_bid_log AS log
					LEFT JOIN customer AS us ON us.id = log.customer_id
					WHERE
						log.auction_id = '.$this->auctionId.'
					ORDER BY
						log.winner_price
					LIMIT  '.$limit.'
				';
		return Yii::app()->db->createCommand($historySql)->queryAll();
	}
}